import fs from 'fs';

fs.readFile('./test.txt', 'utf8', (err, data) => {
    if (err) throw err;
    console.log("Callback 版本:");
    console.log(data);
    console.log("==============================");
});

const data = fs.readFileSync('./test.txt', 'utf8');
console.log("同步版本:");
console.log(data);